Skip to content

feat(atlas-core): attribute occurrences to registered source roots (#3125 slice 6) - #14036

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
any-n/3125-slice-6-occurrence-attribution
Nov 24, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
any-n/3125-slice-6-occurrence-attribution

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Related to #3125. Slice 6 of the provenance registry programme (slices 2-5 on main: occurrence writes, read side, source registry, resolve_source).

Summary

lookup_by_hash takes an optional source-registry connection and each ChunkOccurrence gains root_id: Option<String> — resolved via slice 5's exact-match resolve_source, carried as root_id when the locator is registered, None otherwise (unattributed, never misattributed). ShardedBackend gains a with_source_registry builder; get-chunk emits root_id only when attributed, so the no-registry wire shape is unchanged. A registry that answers with a genuine failure fails the lookup (fail-closed, same philosophy as a failing shard). The book's corpus-and-provenance chapter records the read-side slices.

After this PR, cargo test -p atlas-core --test occurrences shows registered locators resolving to their root end to end through get-chunk, and unregistered lookups behaving exactly as before.

Evidence

Ran on the laptop at 6509aaa via fleet-build-lock (no --features web; slice touches no web code):

  • cargo test --manifest-path pkgs/atlas-search/Cargo.toml -p atlas-core --test occurrences — 6 passed (4 existing updated for the new param/field + 2 new oracle tests)
  • cargo test -p atlas-core --test source_registry --test disclosure --test parity --test shards --test aggregate — 7 + 19 + 6 + 16 + 7 passed, 0 failed
  • cargo test -p atlas-core --lib — 184 passed, 0 failed
  • cargo fmt --check clean
  • Not run here: clippy is blocked workspace-wide in this environment by the pre-existing rlib/rustc mismatch in the untouched atlas-proto crate (E0514, same as slice 4); nightly CI is the venue for it.

Oracle: slice 5's exact-match resolution contract — the registry answers which root holds a locator, and the lookup carries that answer onto the row. The positive assertions fail against a no-op implementation (no attribution without the new code path).

Merge Danger

Low. Additive only: one optional field, one optional parameter, one builder defaulting to absent. No behavior change without an attached registry. Revert-safe: dropping the commit restores the pre-slice API consumers (callers updated in-tree).

Next slice (named, for the following worker): serving-side wiring — thread the catalog registry path from the CLI/service config into ShardedBackend::with_source_registry so served get-chunk responses carry attribution.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T02:54:58Z",
    "session_id": "ses_e5df49352a7ffeAAMXW4DE7EW4",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/code-3125-slice6",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/code-3125-slice6",
      "repo": "developing-today/code",
      "branch": "any-n/3125-slice-6-occurrence-attribution",
      "sha": "6509aaa1e3d3eeb10b8403f93351b010c327fdb0"
    },
    "auth_subject": "oc-code-06",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…3125 slice 6)

lookup_by_hash takes an optional source-registry connection; each
ChunkOccurrence carries root_id when its locator is registered,
staying unattributed otherwise. ShardedBackend gains
with_source_registry; no-registry behavior and wire shape unchanged.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7572f8df-f37b-44e0-bb6a-2a0eeebdad3f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant